home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mars Digital Image Map
/
Mars Digital Image Map - Disc 1.iso
/
software
/
vax
/
cdcopy.com
next >
Wrap
Text File
|
1991-11-14
|
9KB
|
116 lines
$!************************************************************************
$!
$!_TITLE CDCOPY - Command file to copy CDROM files to magnetic disk
$!
$!_DESCR
$!
$! The CDCOPY command file is to be used by VAX/VMS systems for
$! copying data files from CDROM media to VMS magnetic disk media.
$! This command file is used in conjunction with the VFS-ISO 9660
$! MOUNT field test kit which allows VMS interface with the CDROM
$! ISO volume and directory standard.
$!
$! The current VMS interface to CDROMs (VFS field test kit) has
$! problems with files that have extended attribute records with
$! a print control value of 0. The dcl COPY command, and other
$! DCL commands, generates an error message when trying to access
$! these kinds of files. The dcl CONVERT utility will properly
$! copy these files to the VMS environment. The CDCOPY command
$! file will create an appropriate FDL file for the given input
$! CDROM file and then execute the CONVERT utility.
$!
$! The CDCOPY command file will convert fixed-length,
$! variable-length, and stream record files. If a file on the
$! CDROM does not contain an extended attribute record, then the
$! command file assumes the file is a stream record file and
$! convert it accordingly.
$!
$! BUG NOTE: Stream record files are not properly converted to the
$! VMS format. The convert utility program adds a carriage-return
$! line-feed sequence on every 512 byte boundary in the file. These
$! extraneous bytes can be removed by editing the converted
$! document.
$!
$! HOW TO RUN THE COMMAND FILE:
$!
$! You can run the CDCOPY command file with the following command:
$!
$! $@CDCOPY in-spec out-spec
$!
$! where 'in-spec' is the input file specification and 'out-spec'
$! is the output file specification. Wild card file specifications
$! are permitted. Shown below are a few examples of how to run
$! the command file (the CDROM device name is assumed to be DUD7:):
$!
$! $@CDCOPY DUD7:[INDEX]IMGINDEX.TAB *
$! $@CDCOPY DUD7:[MG05NXXX]*.IMG *
$! $@CDCOPY DUD7:[GAZETTER]GAZETTER.TAB OUT:TEST.TAB
$!
$!
$!_HIST Eric Eliason, USGS Flagstaff, Origianl Version
$!*************************************************************************
$ PFILE = "" !
$ FILESPEC = P1 !
$ OFILE = P2 !
$ IF P1.EQS."" - !
THEN - !
INQUIRE FILESPEC "Enter CDROM input file specification" !
$! ENDIF !
$ IF P2.EQS."" - !
THEN - !
INQUIRE OFILE "Enter output magnetic disk device " !
$! ENDIF !
$LOOP: !
$ IFILE = F$SEARCH(FILESPEC) !
$ IF IFILE.EQS.PFILE THEN GOTO DONE !
$ PFILE = IFILE !
$ IF IFILE.EQS."" THEN GOTO DONE !
$ MRS = F$FILE_ATTRIBUTES(IFILE,"MRS") !
$ RFM = F$FILE_ATTRIBUTES(IFILE,"RFM") !
$ IF RFM .EQS. "FIX" THEN GOTO FIX !
$ IF RFM .EQS. "VAR" THEN GOTO VAR !
$ IF RFM .EQS. "UDF" THEN GOTO UDF !
$ GOTO ERROR !
$FIX: OPEN/WRITE T CD.FDL !
$ WRITE T "RECORD" !
$ WRITE T " BLOCK_SPAN YES" !
$ WRITE T " CARRIAGE_CONTROL NONE" !
$ WRITE T " FORMAT FIXED" !
$ WRITE T " SIZE ",MRS !
$ CLOSE T !
$ WRITE SYS$OUTPUT "Copy ",IFILE," to ",OFILE !
$ WRITE SYS$OUTPUT "fixed-length record file is assumed" !
$ GOTO CVT !
$VAR: OPEN/WRITE T CD.FDL !
$ WRITE T "RECORD" !
$ WRITE T " BLOCK_SPAN YES" !
$ WRITE T " CARRIAGE_CONTROL NONE" !
$ WRITE T " FORMAT VARIABLE" !
$ WRITE T " SIZE 0" !
$ CLOSE T !
$ WRITE SYS$OUTPUT "variable-length record file is assumed" !
$ WRITE SYS$OUTPUT "Copy ",IFILE," to ",OFILE !
$ GOTO CVT !
$UDF: OPEN/WRITE T CD.FDL !
$ WRITE T "RECORD" !
$ WRITE T " BLOCK_SPAN YES" !
$ WRITE T " CARRIAGE_CONTROL NONE" !
$ WRITE T " FORMAT STREAM" !
$ WRITE T " SIZE 0" !
$ CLOSE T !
$ WRITE SYS$OUTPUT "Copy ",IFILE," to ",OFILE !
$ WRITE SYS$OUTPUT "file has undefined format, stream file assumed" !
$ GOTO CVT !
$CVT: !
$ WRITE SYS$OUTPUT " " !
$ CONVERT/FDL=CD.FDL 'IFILE' 'OFILE' !
$ DELETE CD.FDL; !
$ GOTO LOOP !
$ !
$DONE: !
$ EXIT !
$ERROR: !
$ WRITE SYS$ERROR IFILE," has unexpected record format, can not copy"!
$ WRITE SYS$ERROR "CDCOPY terminates" !
$ EXIT !